﻿using PHMEE.ToolKits;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE
{
    /// <summary>
    /// 燃油分油机齿式传动
    /// </summary>
    public class FuelOilSeparatorGear : Equipment
    {
        protected FuelOilSeparatorGear()
        {

        }

        public FuelOilSeparatorGear(Guid id, Guid unitId, string name,string nameen, int number)
            : base(id, unitId, name, nameen, number)
        {

        }

        /// <summary>
        /// 容量
        /// </summary>
        [NotMapped]
        public double Capacity { get; set; }

        /// <summary>
        /// 转速
        /// </summary>
        [NotMapped]
        public double Speed { get; set; }

        /// <summary>
        /// 小螺旋齿数
        /// </summary>
        [NotMapped]
        public double SmallTeethNumber { get; set; }

        /// <summary>
        /// 大螺旋齿数
        /// </summary>
        [NotMapped]
        public double BigTeethNumber { get; set; }

        /// <summary>
        /// 支撑方式
        /// </summary>
        [NotMapped]
        public SupportFlexibilityMode SupportFlexibilityMode { get; set; }

        /// <summary>
        /// 转动方式
        /// </summary>
        [NotMapped]
        public RotationMode RotationMode { get; set; }

        /// <summary>
        /// 基座类型
        /// </summary>
        [NotMapped]
        public ConnectMode ConnectMode { get; set; }

        /// <summary>
        /// 横轴驱动端轴承型号
        /// </summary>
        [NotMapped]
        public string HorDriveEndBearModel { get; set; }

        /// <summary>
        /// 横轴驱动端轴承厂商
        /// </summary>
        [NotMapped]
        public int HorDriveEndBearFactory { get; set; }

        /// <summary>
        /// 横轴自由端轴承型号
        /// </summary>
        [NotMapped]
        public string HorNonDriveEndBearModel { get; set; }

        /// <summary>
        /// 横轴自由端轴承厂商
        /// </summary>
        [NotMapped]
        public int HorNonDriveEndBearFactory { get; set; }

        /// <summary>
        /// 上轴承型号
        /// </summary>
        [NotMapped]
        public string UpBearModel { get; set; }

        /// <summary>
        /// 上轴承厂商
        /// </summary>
        [NotMapped]
        public int UpBearFactory { get; set; }

        /// <summary>
        /// 下轴承型号
        /// </summary>
        [NotMapped]
        public string DownBearModel { get; set; }

        /// <summary>
        /// 下轴承厂商
        /// </summary>
        [NotMapped]
        public int DownBearFactory { get; set; }

        public override void DeserializeProperties()
        {
            PHMEECoreHelper.SetDerivedProperties(this, DerivedPropertiesJson);
        }

        public override void SerializeProperties(Dictionary<string, object> derivedPropertiesJson)
        {
            var properties = PHMEECoreHelper.GetDerivedProperties(this);
            this.DerivedPropertiesJson = derivedPropertiesJson.Where(item => properties.Keys.Any(p => string.Equals(p, item.Key, StringComparison.OrdinalIgnoreCase))).ToDictionary();
        }
    }
}
